using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
using Microsoft.BizTalk.PipelineOM;
using Microsoft.BizTalk.Component.Interop;
using System.Resources;
using System.Reflection;

namespace eliasen.eu.BizTalk.PipelineComponents
{
    [ComponentCategory(CategoryTypes.CATID_PipelineComponent)]
    [ComponentCategory(CategoryTypes.CATID_Any)]
    [Guid("8063ae76-2544-4326-bc2d-eba8f57f3b60")]
    public class WriteProperties : IBaseComponent, IComponentUI, IComponent, IPersistPropertyBag
    {
        ResourceManager rm;

        public WriteProperties()
        {
            rm = Util.GetResourceManager();
        }

        #region IBaseComponent Members

        public string Description
        {
            get
            {
                return rm.GetString("WriteProperties_Description");
            }
        }

        public string Name
        {
            get
            {
                return rm.GetString("WriteProperties_Name");
            }
        }

        public string Version
        {
            get
            {
                return rm.GetString("WriteProperties_Version");
            }
        }

        #endregion

        #region IComponentUI Members

        public IntPtr Icon
        {
            get
            {
                return new System.IntPtr();
                //return ((Bitmap) resourceManager.GetObject("CompIcon")).GetHicon();
            }
        }

        public System.Collections.IEnumerator Validate(object projectSystem)
        {
            return null;
        }

        #endregion

        #region IComponent Members

        public Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(IPipelineContext pContext, Microsoft.BizTalk.Message.Interop.IBaseMessage pInMsg)
        {
            Util.WriteMessageContext(pInMsg.Context);
            return pInMsg;
        }

        #endregion

        #region IPersistPropertyBag Members

        public void GetClassID(out Guid classID)
        {
            classID = new Guid("8063ae76-2544-4326-bc2d-eba8f57f3b60");
        }

        public void InitNew()
        {

        }

        public void Load(IPropertyBag propertyBag, int errorLog)
        {
        }

        public void Save(IPropertyBag propertyBag, bool clearDirty, bool saveAllProperties)
        {
        }

        #endregion
    }
}
